package guowenlong.golf.ui.friendlymatch;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.ViewHolder;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import guowenlong.golf.R;
import java.util.ArrayList;

/**
 * des   : 描述
 * author: Administrator
 * email : guowenlong20000@gmail.com
 * time  : 2017年05月08日 上午 12:58.
 */

public class ResultTableAdapter extends
    RecyclerView.Adapter<RecyclerView.ViewHolder> {

  private Context context;
  private ArrayList<ResultTableEntity> resultTableEntity;

  public ResultTableAdapter(Context context, ArrayList<ResultTableEntity> resultTableEntity) {
    this.resultTableEntity = resultTableEntity;
    this.context = context;
  }

  public class ViewHolder1 extends RecyclerView.ViewHolder {

    public ViewHolder1(View arg0) {
      super(arg0);
    }

    ImageView mImg;
    TextView mTxt;
  }

  @Override
  public int getItemCount() {
    return resultTableEntity.size() + 1;
  }

  /**
   * 创建ViewHolder
   */
  @Override
  public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
    View view = View.inflate(context, R.layout.item_setting_result_table, null);
    ViewHolder1 viewHolder1 = new ViewHolder1(view);
//    viewHolder1.mImg = (ImageView) view.findViewById(R.id.id_index_gallery_item_image);
    return viewHolder1;
  }

  /**
   * 设置值
   */
  @Override
  public void onBindViewHolder(final RecyclerView.ViewHolder viewHolder, final int i) {
    if (viewHolder instanceof ViewHolder1) {
//      ((ViewHolder1) viewHolder).mTxt.setText(mDatas.get(i));
    }
  }
}